//
// Created by hoyin on 2023/5/12.
//

#ifndef WORKSPACE_2023_05_12_09_03_23_SPACERESECTION_H
#define WORKSPACE_2023_05_12_09_03_23_SPACERESECTION_H

#include "eigen-3.4.0/Eigen/Dense"
#include "fstream"
#include "vector"
#include "iostream"
#include "chrono"

using namespace Eigen;
using namespace std;

class SpaceResection {
private:
std::vector<std::string> split(std::string str, std::string pattern)
{
	std::string::size_type pos;
	std::vector<std::string> result;
	str += pattern;//扩展字符串以方便操作
	int size = str.size();
	for (int i = 0; i < size; i++)
	{
		pos = str.find(pattern, i);
		if (pos < size)
		{
			std::string s = str.substr(i, pos - i);
			result.push_back(s);
			i = pos + pattern.size() - 1;
		}
	}
	return result;
}

public:
Matrix<double, Dynamic, 2> imageSpacePoints;
Matrix<double, Dynamic, 3> objectSpacePoints;
double f, x0, y0, scale;

SpaceResection(string dataPath);
void solve();
};


#endif //WORKSPACE_2023_05_12_09_03_23_SPACERESECTION_H
